import CryptoJS from "crypto-js";
import { v4 as uuidv4 } from "uuid";
import { useUserStore } from "@/store/modules/user";
// MD5 加密方法
const generateMD5Hash = (input) => {
  return CryptoJS.MD5(input).toString();
};
const generateUUID = () => {
  // 生成 UUID
  return uuidv4();
  // 可以将 UUID 用于需要唯一标识的场景
};
export function generateMD5Validate() {
  let OCR_TIME = Date.now();
  let OCR_UUID = generateUUID();
  let OCR_SECRET = generateMD5Hash(OCR_UUID + "_" + OCR_TIME);
  return {
    OCR_TIME,
    OCR_UUID,
    OCR_SECRET,
  };
}
/***
 * 找到 从业人员的公司的type
 */
export function findPranctitionerMerchantCompanyVO() {
  const userInfo = useUserStore().userInfo;
  return userInfo?.merchantCompanyVO;
}
